<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ja">
  <head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>A canvas textAlign example</title>

    <script type="text/xaml" id="xaml"><?xml version="1.0"?>
      <Canvas xmlns="http://schemas.microsoft.com/client/2007"></Canvas></script>
<script type="text/javascript" src="../uupaa-excanvas.js"></script>

    <script>
    function boot() {
      draw(document.getElementById('canvas').getContext('2d'));
      draw(document.getElementById('vmlcanvas').getContext('2d'));
    }
    function draw(ctx) {
      var w = 500, h = 250;
      var fillText = "textAlign";

      // center pole
      ctx.beginPath();
      ctx.moveTo(w / 2, 0);
      ctx.lineTo(w / 2, h);
      ctx.strokeStyle = "SkyBlue";
      ctx.stroke();

      // setting
      ctx.font          = "32pt Arial";
      ctx.fillStyle     = "red";
      ctx.textBaseline  = "top";

      ctx.textAlign     = "start";
      ctx.fillText(ctx.textAlign, w / 2, 0);

      ctx.textAlign     = "left";
      ctx.fillText(ctx.textAlign, w / 2, 40);

      ctx.textAlign     = "center";
      ctx.fillText(ctx.textAlign, w / 2, 80);

      ctx.textAlign     = "end";
      ctx.fillText(ctx.textAlign, w / 2, 120);

      ctx.textAlign     = "right";
      ctx.fillText(ctx.textAlign, w / 2, 160);
    }
    </script>
    <style type="text/css">
      body { margin: 20px; font-family: arial,verdana,helvetica; background: #fff;}
      h1 { font-size: 140%; font-weight:normal; color: #036; border-bottom: 1px solid #ccc; }
      canvas { border: 2px solid #000; float: left; margin-right: 20px; margin-bottom: 20px; }
      pre { float:left; display:block; background: rgb(238,238,238); border: 1px dashed #666; padding: 15px 20px; margin: 0 0 10px 0; }
    </style>
  </head>
  <body onload="uuCanvas.ready(boot);">
    <h1>A canvas <code>textAlign</code> example</h1>
    <div>
      <canvas id="canvas" width="500" height="250"></canvas>
      <canvas id="vmlcanvas" class="vml" width="500" height="250"></canvas>
      <pre>
function boot() {
  draw(document.getElementById('canvas').getContext('2d'));
  draw(document.getElementById('vmlcanvas').getContext('2d'));
}
function draw(ctx) {
  var w = 500, h = 150;
  var fillText = "textAlign";

  // center pole
  ctx.beginPath();
  ctx.moveTo(w / 2, 0);
  ctx.lineTo(w / 2, h);
  ctx.strokeStyle = "SkyBlue";
  ctx.stroke();

  // setting
  ctx.font          = "32pt Arial";
  ctx.fillStyle     = "red";
  ctx.textBaseline  = "top";

  ctx.textAlign     = "start";
  ctx.fillText(ctx.textAlign, w / 2, 0);

  ctx.textAlign     = "left";
  ctx.fillText(ctx.textAlign, w / 2, 40);

  ctx.textAlign     = "center";
  ctx.fillText(ctx.textAlign, w / 2, 80);

  ctx.textAlign     = "end";
  ctx.fillText(ctx.textAlign, w / 2, 120);

  ctx.textAlign     = "right";
  ctx.fillText(ctx.textAlign, w / 2, 160);
}
      </pre>
    </div>
  </body>
</html>
